package tech.aistar.day08.equal;


/**
 * 本类用来演示: equals
 *
 * @author: success
 * @date: 2021/3/17 8:37 上午
 */
public class TestBook {
    public static void main(String[] args) {
        //并行开发...
        Book b5 = new Book(5,"1005","西游记",600.0d);
        BookInfo info = new BookInfo(1,"aaa");
        b5.setBookInfo(info);

        Book b6 = new Book(5,"1005","西游记2",700.0d);
        BookInfo info2 = new BookInfo(1,"bbb");
        b6.setBookInfo(info2);

        System.out.println(b5 == b6);//false

        System.out.println(b5.equals(b6));//true

        System.out.println(Integer.toHexString(b5.hashCode()));//1700ff


    }
}
